package com.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 任务仓库
 * @author wty
 * @since 2021-01-12
 */
@Data
@Accessors(chain = true)
@TableName("task_store")
public class TaskStore extends Model<TaskStore> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 任务名字
     */
    private String name;
    /**
     * 创建时间
     */
    @TableField("create_time")
    private Integer createTime;
    /**
     * 父任务id
     */
    @TableField("parent_id")
    private Integer parentId;
    /**
     * 是否叶子任务
     */
    @TableField("is_leafage")
    private Integer isLeafage;
    /**
     * 任务标签
     */
    @TableField("label_id")
    private Integer LabelId;
    /**
     * 关联的卡片
     */
    @TableField("card_id")
    private String cardId;

    /**
     * 任务
     * @return
     */
    @TableField(exist = false)
    private TaskRecord taskRecord;

    /**
     * cardList
     * @return
     */
    @TableField(exist = false)
    private List<Card> cardList=new ArrayList<>();


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
